package model;

import view.TextScreen;

import java.util.LinkedHashSet;
import java.util.Observable;


/**
 * Created with IntelliJ IDEA.
 * User: phuc_lagger
 * Date: 11/10/13
 * Time: 4:03 PM
 * To change this template use File | Settings | File Templates.
 */
public class Alien implements MyUnit {

    private Point topLeft;
    boolean isLeft = true;

    public Alien(Point topLeft) {
        this.topLeft = topLeft;

    }

    @Override
    public Point getLocation() {
        return this.topLeft;
    }


    public void setLocation(Point p) {
        topLeft = p;
//        setChanged();
//        notifyObservers(this);
    }


    @Override
    public void move() {

//        if (topLeft.x == 2) {
//            isLeft = false;
//            topLeft.y++;
//        } else if (topLeft.x == 93) {
//            isLeft = true;
//            topLeft.y++;
//        }
        if (isLeft) {
            topLeft.moveLeft();
//            setLocation(topLeft);

        } else {
            topLeft.moveRight();
//            setLocation(topLeft);

        }


    }

    public void setIsLeft(boolean d){
        isLeft = d;

    }




}